<?php
/**
 * 请假管理
 * @author Administrator
 *
 */
namespace Manager\Controller;
use Home\Controller\CommonController;
class LeaveController extends CommonController {
	
	private $class;
	
	function _initialize(){
		parent::_initialize();
		$this->class = D("YgclClass");
	}
	
	public function index(){
		$uid = $_SESSION['_loginUser_home']['uid'];
		$did = I('get.did');
		$this->list = $this->class->where(array('did'=>$did,'status'=>1))->order('listorder desc')->select();
		$this->display();
	}
	
	public function lesson(){
		$cid = I('get.cid');
		$this->classinfo = $this->class->where(array('id'=>$cid))->find();
		$this->list = D('YgclLesson')->where(array('cid'=>$cid,'status'=>1))->relation(true)->order('listorder desc')->select();
		$this->display();
	}
	
	public function leavelist(){
		$this->display();
	}
	
	public function leaveedit(){
		if(isset($_GET['id'])){
			$info = D('YgclSign')->find($_GET['id']);
			$this->info = $info;
	
			$lid = $info['lid'];
		}else{
			$lid = I('lid');
		}
		//当前学期
		$terminfo = F('Termdata');
		//获取学生
		// 		$udrid = I('udrid');
		$this->lid = $lid;
		$students = D("LessonStudentRelation")->where(array('tid'=>$terminfo['id'],'lid'=>$lid))->select();
		//dump($students);
		$this->students = $students;
		$this->display();
	}
	
}